function UtilMap() {
    var struct = function (key, value) {
        this.key = key;
        this.value = value;
    };

    var put = function (key, value) {
        for (var i = 0; i < this.arr.length; i++) {
            if (this.arr[i].key === key) {
                this.arr[i].value = value;
                return;
            }
        }
        this.arr[this.arr.length] = new struct(key, value);
    };

    var get = function (key) {
        for (var i = 0; i < this.arr.length; i++) {
            if (this.arr[i].key === key) {
                return this.arr[i].value;
            }
        }
        return null;
    };

    var getAllValue = function () {
        var values = [];
        for (var i = 0; i < this.arr.length; i++) {
            values[i] = this.arr[i].value;
        }
        return values;
    };

    var getKey = function (index) {
        if (index > -1 && index < this.arr.length) {
            return this.arr[index].key;
        }
        return null;
    };
    var remove = function (key) {
        var v;
        for (var i = 0; i < this.arr.length; i++) {
            v = this.arr.pop();
            if (v.key === key) {
                continue;
            }
            this.arr.unshift(v);
        }
    };

    var removeAll = function () {
        this.arr.length = 0;
    };

    var size = function () {
        return this.arr.length;
    };

    var isEmpty = function () {
        return this.arr.length <= 0;
    };
    this.arr = [];
    this.get = get;
    this.getAllValue = getAllValue;
    this.getKey = getKey;
    this.put = put;
    this.remove = remove;
    this.removeAll = removeAll;
    this.size = size;
    this.isEmpty = isEmpty;
}